﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ProductsReport.aspx.cs" Inherits="FYPHP.Reports.ProductsReport" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">    var num = 0; </script>
<h2>Report for Products</h2>
<table>
<tr><td>Sort by</td><td>:</td>
<td><asp:DropDownList ID="DropDownList1" runat="server">
          <asp:ListItem Value="p_date" Selected="True">Date</asp:ListItem>
          <asp:ListItem Value="p_name">Name</asp:ListItem>
          <asp:ListItem Value="p_price">Price</asp:ListItem>
          <asp:ListItem Value="p_views">Views</asp:ListItem>
          <asp:ListItem Value="username">Seller</asp:ListItem>
          <asp:ListItem Value="p_status">Status</asp:ListItem>
    </asp:DropDownList>
    <asp:CheckBox ID="CheckBox1" runat="server" Text="Descending" style="font-size: 11px;" /></td></tr>

    <tr><td>From Date</td><td>:</td><td>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="Disabled"></asp:TextBox>
    <ajaxToolkit:CalendarExtender ID="CalendarExtenderDM" runat="server"
            TargetControlID="TextBox1" Format="dd/MM/yyyy" /></td></tr>
    <tr><td>To Date</td><td>:</td><td>
    <asp:TextBox ID="TextBox3" runat="server" AutoCompleteType="Disabled"></asp:TextBox>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server"
            TargetControlID="TextBox3" Format="dd/MM/yyyy" /></td></tr>

    <tr><td colspan="2"></td><td>
    <asp:Button ID="btnSort" runat="server" Text="View Report" onclick="btnSort_Click" /></td></tr>
</table>    
<asp:Repeater ID="ItemList" runat="server" EnableViewState="False">
<HeaderTemplate>
<table cellpadding="5" cellspacing="5" width="722" border="1px solid #ffffff" align="center" style="border-collapse: collapse; border-color: #aaaaaa; text-align: center; margin-top: 5px">
 <tr style="background-color: #eee; font-weight: bold;"><td width="30px">No.</td><td>Date</td><td>Product Name</td><td>Price</td><td>Views</td><td>Seller</td><td>Status</td></tr>

</HeaderTemplate>

<ItemTemplate>
     <tr>
     <td><script type="text/javascript">num += 1; document.write(num);</script></td>
     <td width="80"><%#DataBinder.Eval(Container.DataItem, "pdate" ) %></td>
            <td style="text-align: left"><a href="/ProductDetails.aspx?id=<%#DataBinder.Eval(Container.DataItem, "p_id" ) %>">
            <%#DataBinder.Eval(Container.DataItem, "p_name" ) %></a><br /> </td>
            <td width="70">$<%#DataBinder.Eval(Container.DataItem, "p_price" ) %></td>
            <td width="35"><%#DataBinder.Eval(Container.DataItem, "p_views" ) %></td>
            <td width="70"><%#DataBinder.Eval(Container.DataItem, "username" ) %></td>
            <td width="70" style="text-transform:capitalize;"><%#DataBinder.Eval(Container.DataItem, "p_status" ) %></td>
        </tr>
   </ItemTemplate>

   <FooterTemplate>
    </table>
    </FooterTemplate>
</asp:Repeater> 
</asp:Content>
